Outputting Debug Strings

SoftwareShield ClientProtector COM Component > Debug and Release Server Versions > Outputting Debug Strings

## Outputting Debug Strings

As described in the section on Controlling Debug Output, when linking to the debug ClientProtector server you can easily control two dimensions of the debug information which is output:

- The level of detail output. (Either "coarse" or "detailed")

- The method of output. (Any of: debug strings, log files and modal dialogs)

You control this by using the values defined in the CPDEBUGFLAGS enumeration exposed by the ClientProtector COM server. These values are simply combined using bit-wise OR operators to achieve the desired effect and passed in the "DebugFlags" parameter of the StartUp function call.

Debug strings are output directly to your IDE event log when you have your IDEs debugger attached to the host process. See Controlling Debug Output for more information. To control debug string messages, four enumerations can be used (in combination with any others):

- DBG_ODS_COARSE - ("Output Debug String Coarse") Use to output debug string messages to your IDE only when an important event happens inside the ClientProtector.

- DBG_ODS_DETAIL - ("Output Debug String Detailed") Use to output debug string messages to your IDE at virtually every internal procedure as it occurs inside the ClientProtector.

- DBG_ALL_COARSE - ("All Methods Coarse") Use to output debug string messages to your IDE (and all other debug output types) only when an important event happens inside the ClientProtector.

- DBG_ALL_DETAIL - ("All Methods Detailed") Use to output debug string messages to your IDE (and all other debug output types) at virtually every internal procedure as it occurs inside the ClientProtector.

For example, if we only wanted detailed debug strings output we would pass DBG_ODS_DETAIL in the DebugFlags parameter of the StartUp call. Or, if we wanted to output only coarse debug string messages into the event log of our IDE, but fine dialog messages, we would combine them with a bit-wise or operator as in : (DBG_ODS_COARSE | DBG_DLG_DETAIL). If we simply want to output all detailed information using every method, we can just use the DBG_ALL_DETAIL value.

An example call might look like this (C++ code):

// initialize the ClientProtector and Start it up
SSCProtector1->StartUp(MainLicenseFileName, MainLicenseFilePassword,
GlobalAuthorizationCodePassword, FingerPrintOptionsCode,
(DBG_ODS_COARSE | DBG_DLG_DETAIL), &return_code);